package com.test.dao.impl;

import com.test.dao.IHeatingSeasonDao;
import com.test.model.HeatingSeason;
import org.hibernate.Query;
import org.springframework.stereotype.Repository;



/**
 * Created by ZZF on 2017/8/8.
 */
@Repository
public class HeatingSeasonDaoImpl extends BaseDaoImpl<HeatingSeason> implements IHeatingSeasonDao {


    @Override
    public HeatingSeason findCurrent() {

        String sql="SELECT * FROM `o_heatingseason` where isCurrent=1";

       Query query= getSession().createSQLQuery(sql).addEntity(HeatingSeason.class);

        return (HeatingSeason)query.uniqueResult();
    }
}
